package com.norma.macaron.service.common.repository.user;

import com.norma.macaron.service.common.domain.user.TRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zhangchaofeng
 * @date 2020/6/8 0008
 * @description
 */
@Repository
public interface RoleRepository extends JpaRepository<TRole,String>,JpaSpecificationExecutor<TRole> {

    @Query("select role from TRole role where role.id in :ids")
    List<TRole> queryRolesInIds(@Param("ids") String[] ids);

}
